package z_Entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 通用实体类
 *
 * @author xuyaxu
 * @date 2022/8/8 22:50
 */
public class User {

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 性别（0男 1女）
     */
    private Integer gender;

    public User() {
    }

    public User(Integer id, String userName, Integer age, Integer gender) {
        this.id = id;
        this.userName = userName;
        this.age = age;
        this.gender = gender;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", age=" + age +
                '}';
    }

    /**
     * 构造案例数据
     *
     * @return 集合
     */
    public static List<User> getUserList() {
        List<User> userList = new ArrayList<>();
        userList.add(new User(1, "jack", 18, 0));
        userList.add(new User(2, "rose", 20, 1));
        userList.add(new User(3, "huahua", 2, 0));
        return userList;
    }
}
